<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Get set of locale keyword values</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="intlcalendar.getgreatestminimum.html">« IntlCalendar::getGreatestMinimum</a></li>
      <li style="float: right;"><a href="intlcalendar.getleastmaximum.html">IntlCalendar::getLeastMaximum »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.intlcalendar.html">IntlCalendar</a></li>
    <li>Get set of locale keyword values</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="intlcalendar.getkeywordvaluesforlocale" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">IntlCalendar::getKeywordValuesForLocale</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.5.0, PHP 7, PHP 8, PECL &gt;= 3.0.0a1)</p><p class="refpurpose"><span class="refname">IntlCalendar::getKeywordValuesForLocale</span> &mdash; <span class="dc-title">Get set of locale keyword values</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-intlcalendar.getkeywordvaluesforlocale-description">
  <h3 class="title">说明</h3>
  <p class="para">
   面向对象风格
  </p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><strong>IntlCalendar::getKeywordValuesForLocale</strong></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$keyword</code></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter">$locale</code></span>, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$onlyCommon</code></span>): <span class="type"><span class="type"><a href="class.intliterator.html" class="type IntlIterator">IntlIterator</a></span>|<span class="type"><span class="type false">false</span></span></span></div>

  <p class="para rdfs-comment">
   过程化风格
  </p>
  <div class="methodsynopsis dc-description"><span class="methodname"><strong>intlcal_get_keyword_values_for_locale</strong></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$keyword</code></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter">$locale</code></span>, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$onlyCommon</code></span>): <span class="type"><span class="type"><a href="class.intliterator.html" class="type IntlIterator">IntlIterator</a></span>|<span class="type"><span class="type false">false</span></span></span></div>

  <p class="para rdfs-comment">
   For a given locale key, get the set of values for that key that would result
   in a different behavior. For now, only the <code class="literal">&#039;calendar&#039;</code>
   keyword is supported.
  </p>
  <p class="para">
   This function requires ICU 4.2 or later.
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-intlcalendar.getkeywordvaluesforlocale-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
<code class="parameter">keyword</code></dt>

    <dd>

     <p class="para">
      The locale keyword for which relevant values are to be queried. Only
      <code class="literal">&#039;calendar&#039;</code> is supported.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">locale</code></dt>

    <dd>

     <p class="para">
      The locale onto which the keyword/value pair are to be appended.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">onlyCommon</code></dt>

    <dd>

     <p class="para">
      Whether to show only the values commonly used for the specified locale.
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-intlcalendar.getkeywordvaluesforlocale-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   An iterator that yields strings with the locale keyword
   values 或者在失败时返回 <strong><code>false</code></strong>.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-intlcalendar.getkeywordvaluesforlocale-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2400">
   <p><strong>示例 #1 <span class="function"><strong>IntlCalendar::getKeyworkValuesForLocale()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />print_r</span><span style="color: #007700">(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">iterator_to_array</span><span style="color: #007700">(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">IntlCalendar</span><span style="color: #007700">::</span><span style="color: #0000BB">getKeywordValuesForLocale</span><span style="color: #007700">(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'calendar'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'fa_IR'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">)));<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">iterator_to_array</span><span style="color: #007700">(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">IntlCalendar</span><span style="color: #007700">::</span><span style="color: #0000BB">getKeywordValuesForLocale</span><span style="color: #007700">(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'calendar'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'fa_IR'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">)));</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Array
(
    [0] =&gt; persian
    [1] =&gt; gregorian
    [2] =&gt; islamic
    [3] =&gt; islamic-civil
)
Array
(
    [0] =&gt; persian
    [1] =&gt; gregorian
    [2] =&gt; islamic
    [3] =&gt; islamic-civil
    [4] =&gt; japanese
    [5] =&gt; buddhist
    [6] =&gt; roc
    [7] =&gt; hebrew
    [8] =&gt; chinese
    [9] =&gt; indian
    [10] =&gt; coptic
    [11] =&gt; ethiopic
    [12] =&gt; ethiopic-amete-alem
)

</pre></div>
    </div>
   </div>
  </p>
 </div>


</div></div></div></body></html>